package org.example.Contant;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class globalExceptionHandler {

    @ExceptionHandler(BusinessException.class)
    public Result<BusinessException> exceptionHandler(BusinessException e){
        return Result.error(e.getCode(),e.getDescription());
    }
}
